function documentmenu (type) {
    var menu = new Array();
    var returnstr = '';
    var menucount = 0;
    var css;
    var style;
    if (type != 'all') {
        menu = setmenu[type];
    } else {
        for (var x in setmenu) {
            menu = menu.concat(setmenu[x]);
        }
    }
    for(var i in menu) {
        if(typeof(menu[i][0]) == 'object') {
            if (css == 'opnFd') {
                style = 'style="display: none;"';
            }
            returnstr += '<ul class="gFdBdy" id="submenu' + menucount + '" '+ style +'>';
            for(var k in menu[i]) {
                if (!menu[i][k][1]) {
                    menu[i][k][1] = 'javascript:;';
                }
                if (!menu[i][k][2]) {
                    menu[i][k][2] = 'icol';
                }
                returnstr += '<li onclick="$.currentnav();">';
                returnstr += '<b class="' + menu[i][k][2] + '"></b><a class="gfNm" title="' + menu[i][k][0] + '" href="' + menu[i][k][1] + '" target="mainframe">' + menu[i][k][0] + '</a>';
                returnstr += '</li>';
            }
            returnstr += '</ul>';
        } else {
            if (!menu[i][1]) {
                menu[i][1] = '';
            }
            if (i != 0) {
                css = 'opnFd';
            } else {
                css = 'clsFd';    
            }
            menucount++;
            returnstr += '<h3 class="gfTit" onClick="$.toggleTree(\'menuico' + menucount + '\', \'submenu' + menucount + '\');">';
            returnstr += '<a href="javascript:;" class="' + css + ' bgF1"  id="menuico' + menucount + '"></a>';
            returnstr += '<span class="gfName">' + menu[i][0] + '</span>';
            returnstr += '</h3>'
        }
    }
    return '<div class="gFd">' + returnstr + '</div>';
}